<%@ page contentType="text/html" %>
<%@ taglib prefix="fmt"    uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c"      uri="http://java.sun.com/jsp/jstl/core" %>


<html>
<head>
    <title>PublishMX Application</title>
    <meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
    <META HTTP-EQUIV="Cache-Control" CONTENT="max-age=0">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <meta http-equiv="expires" content="0">
    <META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <link href="/publishmx/css/publishMX.css" rel="stylesheet" type="text/css" media="screen" />

    <%-- <style type="text/css">
        @import "http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/themes/tundra/tundra.css";
        @import "http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/resources/dojo.css"
    </style>

            <script type="text/javascript" src="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/dojo.js"
		djConfig="parseOnLoad: false, isDebug: true"></script>

    <script type="text/javascript">

            dojo.require("dijit.form.InlineEditBox");
            dojo.require("dijit.form.DateTextBox");
            dojo.require("dijit.form.RadioButton");

    </script>
    --%>

    <%--style type="text/css">
        @import "http://o.aolcdn.com/dojo/1.0/dijit/themes/tundra/tundra.css";
        @import "http://o.aolcdn.com/dojo/1.0/dojo/resources/dojo.css"
    </style>
    <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.0/dojo/dojo.xd.js"
            djConfig="parseOnLoad: true">
    </script>
     <script type="text/javascript" src="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/dojo.js"
		djConfig="parseOnLoad: false, isDebug: true"></script>
    <script type="text/javascript">
            dojo.require("dijit.form.InlineEditBox");
            dojo.require("dijit.form.DateTextBox");
            dojo.require("dijit.form.RadioButton");

    </script>
    --%>
</head>
<body class="tundra">
<%@ include file="../includes/menuInclude.jsp" %>
<script type="text/javascript">
    function getPhoneNumbersByMsgId(msgId,typeOut){
        document.reportForm.msgId.value= msgId;
        document.reportForm.typeOut.value= typeOut;
        document.reportForm.action="showListPhoneNumbers.htm";
        document.reportForm.submit();             
    }
</script>
<div id="content">
    <div class="post">
        <div class="title">
            <h2>Report Form</h2>
            <p></p>
        </div>
        <div class="entry">
            <form action="searchReportView.htm" method="POST" name="reportForm">
                <table>
                    <tr>
                        <td>Type of Message:</td>
                        <td>
                            <input type="radio" dojoType="dijit.form.RadioButton" name="typeSms" checked value="IN" id="inType" /><label for="inType"> Received Messages </label>
                            <input type="radio" dojoType="dijit.form.RadioButton" name="typeSms" value="OUT" id="outType"/><label for="outType"> Send Messages </label>                      
                        </td>
                    </tr>
                    <tr>
                        <td><b>Criteria Date:</b></td>
                        <td>From <input type="text" name="fromDate"> to <input type="text" name="toDate"></td>
                    </tr>             
                    <tr>
                        <td colspan="2" align="right"> <input type="submit" value="Search"></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>                     
                        </td>
                    </tr>
                    
                </table>
                <input type="hidden" name="msgId" value="">
                <input type="hidden" name="typeOut" value="">
            </form>
        </div>
    </div>
</div>
<c:if test="${!empty msgOutAgenda}">
    <br/>
    <table>
        <tr>
            <td colspan="3"><h2>Message Sent to Agenda's Contacts</h2></td>
        </tr>
        <tr>
            <th>Message Text</th>       
            <th>Created Date</th>
            <th>Send By</th>
        </tr>
        <c:forEach var="msg" items="${msgOutAgenda}" >
            <tr>                                    
                <td><a href="#" onClick="getPhoneNumbersByMsgId(${msg.id},'Agenda');">${msg.text}</a></td>    
                <td>${msg.createDate}</td>
                <td>${msg.senderName}</td>
            </tr>   
        </c:forEach> 
    </table>
</c:if>
<c:if test="${!empty msgOutInd}">
<br>
    <table>
    <tr>
        <td colspan="3"><h2>Message Sent Indivudal</h2></td>
    </tr>
    <tr>
        <th>Message Text</th>
        <th>Created Date</th>
        <th>Send By</th>
    </tr>
    <c:forEach var="msg" items="${msgOutInd}" >
        <tr>
            <td><a href="#" onClick="getPhoneNumbersByMsgId(${msg.id},'Individual');">${msg.text}</a></td>
            <td>${msg.createDate}</td>
            <td>${msg.senderName}</td>
        </tr>
    </c:forEach>
</table>
</c:if>
<c:if test="${!empty msgIn}">
    <br>
    <table>
        <tr>
            <td colspan="3"><h2>Message Received</h2></td>
        </tr>
        <tr>
            <th>Message Text</th>
            <th>Created Date</th>
            <th>Phone</th>
        </tr>
        <c:forEach var="msg" items="${msgIn}" >
            <tr>
                <td>${msg.text}</td>
                <td>${msg.createDate}</td>
                <td>${msg.inputPhoneNumber}</td>
            </tr>
        </c:forEach>
    </table>
</c:if>

<c:if test="${!empty outMsg}">
    <table>
        <tr>
            <td>Text: </td>
            <td>${outMsg.text}</td>
       </tr>
        <tr>
            <td>Numbers </td>
            <td>
                <c:forEach var="number" items="${outMsg.numbersList}" >
                    ${number}<br/>
                </c:forEach>
            </td>
        </tr>
    
    </table>
    
</c:if>
<%--
<p id="backgroundArea" dojoType="dijit.form.InlineEditBox" >
    <input name="date" value="2005-12-30" dojoType="dijit.form.DateTextBox"
           constraints="{datePattern:'MM/dd/yy'}"
           lang="en-us"
           required="true"
           promptMessage="mm/dd/yy"
           invalidMessage="Invalid date. Please use mm/dd/yy format."/>
</p>
<br/>
<input name="date02" value="2005-12-30" dojoType="dijit.form.DateTextBox"
       constraints="{datePattern:'MM/dd/yy'}"
       lang="en-us"
       required="true"
       promptMessage="mm/dd/yy"
       invalidMessage="Invalid date. Please use mm/dd/yy format."/>
<!--div>
				From: <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox"
					required="true"
					onChange="dijit.byId('toDate').constraints.min = this.attr('value');" />
				To: <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox"
					required="true"
					onChange="dijit.byId('fromDate').constraints.max = this.attr('value');" />
			</div-->
--%>
<%@ include file="../includes/bottomInclude.jsp" %>
